<?php
$this->widget('bootstrap.widgets.TbBreadcrumbs', array(
    'links' => array('Liên hệ'),
    'htmlOptions' => array('id' => 'breadcrumb')
));
?>

<h2>Liên hệ</h2>

<?php if (Yii::app()->user->hasFlash('contact')): ?>

    <div class="flash-success">
        <?php echo Yii::app()->user->getFlash('contact'); ?>
    </div>

<?php else: ?>
    <div class="widget-container">
        <?php
        $form = $this->beginWidget('CActiveForm', array(
            'id' => 'contact-form',
            'htmlOptions' => array(
                'enctype' => 'multipart/form-data',
                'class' => 'form-horizontal'
            ),
        ));
        ?>

        <?php echo $form->errorSummary($model); ?>

        <div class="control-group">
            <?php echo $form->labelEx($model, 'name', array('class' => 'control-label')); ?>
            <div class="controls">
                <?php echo $form->textField($model, 'name'); ?>
                <?php echo $form->error($model, 'name'); ?>
            </div>

        </div>

        <div class="control-group">
            <?php echo $form->labelEx($model, 'email', array('class' => 'control-label')); ?>
            <div class="controls">
                <?php echo $form->textField($model, 'email'); ?>
                <?php echo $form->error($model, 'email'); ?>
            </div>
        </div>
        <div class="control-group">
            <?php echo $form->labelEx($model, 'phone', array('class' => 'control-label')); ?>
            <div class="controls">
                <?php echo $form->textField($model, 'phone'); ?>
                <?php echo $form->error($model, 'phone'); ?>
            </div>
        </div>
        <div class="control-group">
            <?php echo $form->labelEx($model, 'subject', array('class' => 'control-label')); ?>
            <div class="controls">
                <?php echo $form->textField($model, 'subject'); ?>
                <?php echo $form->error($model, 'subject'); ?>
            </div>
        </div>

        <div class="control-group">
            <?php echo $form->labelEx($model, 'body', array('class' => 'control-label')); ?>
            <div class="controls">
                <?php echo $form->textArea($model, 'body'); ?>
                <?php echo $form->error($model, 'body'); ?>
            </div>
        </div>

        <div class="form-actions">
            <?php echo CHtml::submitButton('Submit',array('class'=>'btn')); ?>
        </div>

        <?php $this->endWidget(); ?>
    </div>
<?php endif; ?>